﻿<UserControl x:Class="SD.Shapes.Samples.CustomConnection.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sd="http://schemas.silverdiagram.net/sd/2010/xaml"
    xmlns:shapesBasic="clr-namespace:SD.Shapes.Templates.Basic;assembly=SD.Shapes.Templates.Basic"
    xmlns:localShapes="clr-namespace:SD.Shapes.Samples.CustomConnection"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="800">

    <Grid Background="White">
        <ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" Background="#EEE">
            <Grid Width="700" Height="500" Background="White" Margin="20">
                <sd:GridRenderer Margin="10" />

                <sd:Diagram Background="Transparent">
                    <shapesBasic:Ellipse Background="LightGreen" x:Name="Ellipse2" Width="80" Height="80" Position="440,100" />
                    <shapesBasic:Ellipse Background="LightGreen" x:Name="Ellipse1" Width="80" Height="80" Position="180,200" />
                    
                    <localShapes:MyConnection Text="Double Click Me" SourceText="Source" SinkText="Sink">
                        <localShapes:MyConnection.Source>
                            <sd:ConnectionPoint ConnectedNode="{Binding ElementName=Ellipse2}" ConnectorIndex="0" />
                        </localShapes:MyConnection.Source>
                        <localShapes:MyConnection.Sink>
                            <sd:ConnectionPoint ConnectedNode="{Binding ElementName=Ellipse1}" ConnectorIndex="1" />
                        </localShapes:MyConnection.Sink>
                    </localShapes:MyConnection>
                </sd:Diagram>
            </Grid>
        </ScrollViewer>
    </Grid>
</UserControl>
